var e = require("../../../@babel/runtime/helpers/interopRequireDefault"), t = require("../../../@babel/runtime/helpers/createForOfIteratorHelper"), r = e(require("../DHttp")), a = require("../../../mycomponent/yz_pay/yz_pay");

Page({
    behaviors: [ a ],
    data: {
        payMethods: [],
        rechargeCount: 0,
        payFeeAliPayOrderSN: ""
    },
    onLoad: function(e) {
        var a = this;
        r.default.request("plugin.credit-inventory.frontend.controllers.recharge.index").then(function(e) {
            var r, n = e.buttons, o = t(n);
            try {
                for (o.s(); !(r = o.n()).done; ) {
                    var i = r.value;
                    i._iconClassName = a.btnclass(i.value);
                }
            } catch (e) {
                o.e(e);
            } finally {
                o.f();
            }
            a.setData({
                payMethods: n
            });
        });
    },
    onReady: function() {},
    onShareAppMessage: function() {},
    inputRechargeCount: function(e) {
        var t = e.detail.value;
        this.setData({
            rechargeCount: t
        });
    },
    payFee: function(e) {
        var t = this, a = e.currentTarget.dataset.type;
        r.default.request("plugin.credit-inventory.frontend.controllers.recharge.handle", {
            pay_way: a,
            recharge_money: this.data.rechargeCount,
            client_type: 2
        }).then(function(e) {
            var r = e.config, n = (e.js, e.order_sn);
            e.uid;
            n || wx.showToast({
                icon: "none",
                title: "参数错误",
                duration: 1500
            }), t.rechargePay(a, r, n, "credit");
        }).catch(function(e) {
            var t = e.msg;
            wx.showToast({
                title: t,
                icon: "none"
            });
        });
    }
});